#!/sbin/openrc-run

supervisor=supervise-daemon

name="Grafana"
description="Metrics Dashboard and Graph Editor"

command="/usr/bin/grafana"
command_args="server $GRAFANA_OPTS"

command_user=grafana:grafana

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -d -o grafana:grafana -m775 /usr/share/grafana/conf \
		/usr/share/grafana/conf/provisioning \
		/usr/share/grafana/conf/provisioning/alerting \
		/usr/share/grafana/conf/provisioning/dashboards \
		/usr/share/grafana/conf/provisioning/datasources \
		/usr/share/grafana/conf/provisioning/notifiers \
		/usr/share/grafana/conf/provisioning/plugins
}
